<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/account.css" />
        <script src="js/jquery-3.3.1.min.js"></script>
         <script src="js/config.js"></script>
		<title>账户信息</title>
	</head>
	<body>
		<div class="page">
			
			
			<div class="top">
				
				<div>
					<h4>账户信息</h4>
				</div>
			</div>
			
			<div class="content">
				
				<div class="userInfo">
					<div>
						<div class="company">大钞市ID</div>
						<div class="accountId">2565456</div>
					</div>
					
					<div class="avatar">
						<img class="headImg" src="./images/avatar.png" alt="" />
					</div>
				</div>
				<!--<div class="info-input">-->
					<!--<div class="title">昵称</div>-->
					<!--<div class="default nick">暂无昵称</div>-->
					<!---->
				<!--</div>-->
				<div class="info-input">
					<div class="title">手机绑定</div>
					<div class="default value">15036858785</div>
				</div>
				<div class="info-input">
					<div class="title">微信绑定</div>
					<div class="default">暂未绑定</div>
				</div>
				<div class="code">
					<div class="title">查看二维码</div>
					<img class="twoCode" src="./images/code.png" alt="" />
				</div>
				
			</div>
			
			
		</div>
		
		
		<script>
			$(function(){
				init();
			})
			
			function init(){
				$.ajax({
					url : host +"/buss/user/info",
					type : "get",
					success:function(res){
						console.log(JSON.stringify(res))
						if(res.success){
							var ID= res.data.id;
						if(res.data.nickName !==null && res.data.nickName>0){
							var nickName = res.data.nickName;
						}
                            if(res.data.headImg !==null && res.data.headImg>0){
                                var headImg = res.data.headImg;
                            }
							
							var phoneNumber=res.data.phone;
							var code = res.data.twoCode;
                            localStorage.setItem("nickName",nickName)
                            localStorage.setItem("code",code)
                            localStorage.setItem("headImg",headImg)
							
							$(".accountId").eq(0).html(ID)
							$(".nick").eq(0).html(nickName)
							
							$(".value").eq(0).html(phoneNumber)
							
							$(".twoCode").eq(0).attr('src',code)
                            $(".headImg").eq(0).attr('src',headImg)
						}
					},
					error:function(){
						console.log("失败")
					}
				})	
			}


            //点击二维码的跳转

            $(".twoCode").eq(0).click(function(){
                window.location.href="./code.html"
            })
		</script>
	</body>
</html>
